#include "Test.h"
#using "CSharpLib.dll"   //dll
#include <iostream>

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
using namespace LockscreenWin10;
using namespace CSharpTest;


bool Test::Print(char* str)
{
    //Uri^ imgUri = gnew Uri("ms-appx:///pic.jpg");
    //Windows::Foundation::IAsyncOperation<Windows::Storage::StorageFile^>^ file1 = StorageFile::GetFileFromApplicationUriAsync(imgUri);
    //auto set = Windows::System::UserProfile::UserProfilePersonalizationSettings::Current;
    //int a = set->TrySetLockScreenImageAsync(file1->GetResults());
    String^ name = System::Runtime::InteropServices::Marshal::PtrToStringAnsi((IntPtr)str);
    LockscreenWin10::LockscreenApi^ api = gcnew LockscreenWin10::LockscreenApi();
    // LockscreenWin10::LockscreenApi  api;
    int a = api->SetLockscreenImageSync(name);
    int aa = a;
    printf("%d", a);
    return 0;
}
